package com.vdong.redis.data.core.json.ops;

import com.vdong.redis.data.core.json.DBExecutor;
import org.springframework.data.redis.core.Cursor;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisOperations;
import org.springframework.data.redis.core.ScanOptions;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;


/**
 * ops覆盖接口，用于动态代理
* @author <a href="mailto:zhudelie@zuozh.com">zhudelie</a>
* @version 
* @since JDK 1.6
* create on 2017年3月31日
* Copyright 2017 ZZJR All Rights Reserved.
*
*/
public interface FastJsonHashOperations<K,HK,HV> extends HashOperations<K,HK,HV> {
	@Deprecated
	void put(K key, HK hashKey, HV value, DBExecutor<HV> db);
	@Deprecated
	void put(K key, HK hashKey, HV value, DBExecutor<HV> db, Long timeout, TimeUnit unit);
	@Deprecated
	HV get(K key, HK hashKey, DBExecutor<HV> db) ;
	@Deprecated
	HV get(K key, HK hashKey, DBExecutor<HV> db, Long timeout, TimeUnit unit) ;
	/**
	 * 根据hashkey，获得指定类型的值
	 * @param key
	 * @param hashKey
	 * @param type
	 * @return
	 */
	<T> T  get(K key, HK hashKey, Class<T> type) ;
	@Deprecated
	<T> T  get(K key, HK hashKey, Class<T> type, DBExecutor<T> db) ;
	@Deprecated
	<T> T  get(K key, HK hashKey, Class<T> type, DBExecutor<T> db, Long timeout, TimeUnit unit) ;
	/**
	 * 删除hashkey
	 */

	Long delete(K key, Object... hashKeys);
	/**
	 * 包含hashkey
	 */

	Boolean hasKey(K key, Object hashKey);
	/**
	 * 根据hashkey得到value
	 */

	HV get(K key, Object hashKey);
	/**
	 * 根据多个hashkey得到多个value
	 */

	List<HV> multiGet(K key, Collection<HK> hashKeys);
	/**
	 * 指定key自增指定大小
	 */

	Long increment(K key, HK hashKey, long delta);
	/**
	 * 指定key自增指定大小
	 */

	Double increment(K key, HK hashKey, double delta);
	/**
	 * 得到所有hashkey
	 */

	Set<HK> keys(K key);
	/**
	 * 得到个数
	 */

	Long size(K key);
	/**
	 * 设置多个值
	 */

	void putAll(K key, Map<? extends HK, ? extends HV> m);
	/**
	 * 设置值
	 */
	
	void put(K key, HK hashKey, HV value);
	/**
	 * 设置值,如果该值不存在的话
	 */
	
	Boolean putIfAbsent(K key, HK hashKey, HV value);
	/**
	 * 得到所有值
	 */
	
	List<HV> values(K key);
	/**
	 * 得到所有key和值
	 */
	
	Map<HK,HV> entries(K key);
	
	Cursor<Map.Entry<HK, HV>> scan(K key, ScanOptions options);
	
	RedisOperations<K, ?> getOperations();
	 
	 
	 
}
